Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timeout command just before dispatch #380

Merged
merged 2 commits into from
Sep 19, 2024

Conversation

cbartz
Copy link
Collaborator

@cbartz cbartz commented Sep 19, 2024

Applicable spec: n/a

Overview

Add timeout command just before dispatch. This is a follow-up for #367 .

Also log juju processes in update-status to assist troubleshooting.

Rationale

The timeout introduced in #367 seems to not have fixed the issue. Local tests outlined that the run-one command is killed after the timeout interval, but a script placed in /tmp/ (called /tmp/juju-exec-aads/script.sh) is still executing and may block the event queue.

See ps aux | grep juju before the timeout

Screenshot from 2024-09-18 16-36-57

and after the timeout:

Screenshot from 2024-09-18 16-37-07

Juju Events Changes

Module Changes

charm.py: Log juju processes in update-status.

Library Changes

Checklist

  • The charm style guide was applied.
  • The contributing guide was applied.
  • The changes are compliant with ISD054 - Managing Charm Complexity
  • The documentation is generated using src-docs.
  • The documentation for charmhub is updated.
  • The PR is tagged with appropriate label (urgent, trivial, complex).
  • The changelog is updated with changes that affects the users of the charm.

@cbartz cbartz added bug Something isn't working trivial labels Sep 19, 2024
@cbartz cbartz requested a review from a team as a code owner September 19, 2024 09:30
Copy link
Contributor

Test coverage for b6d41f5

Name                         Stmts   Miss Branch BrPart  Cover   Missing
------------------------------------------------------------------------
src/charm.py                   597    150    151     26    72%   237-239, 305-324, 342-344, 345->349, 375-379, 452, 459-461, 488-493, 510-516, 537, 549-555, 570-571, 590-591, 600, 605, 635-636, 638->647, 642->647, 652-658, 692, 696-701, 752-757, 766->769, 792-804, 808-809, 837-864, 877-882, 901-911, 926-928, 975-976, 978-979, 981-982, 1061->1063, 1128-1129, 1167-1169, 1177-1183, 1261-1314, 1318
src/charm_state.py             452     17     96      5    95%   271-283, 508-512, 634-635, 690-691, 1126->1129, 1133-1134, 1181
src/errors.py                   25      0      0      0   100%
src/event_timer.py              52      6      0      0    88%   105-106, 143-144, 160-161
src/firewall.py                 51     18     20      0    61%   42-43, 66-69, 111-185
src/github_client.py            23      2      6      1    90%   66->exit, 71-72
src/logrotate.py                43      0      2      0   100%
src/lxd_type.py                 35      0      2      0   100%
src/runner_manager_type.py      51      0      8      0   100%
src/runner_type.py              38      0     10      0   100%
src/shared_fs.py                93     17     10      1    83%   52-53, 120-121, 146-147, 155-156, 162-163, 181, 184-185, 197-198, 241-242
src/utilities.py                32      4      6      2    79%   66-69, 111
------------------------------------------------------------------------
TOTAL                         1492    214    311     35    83%

Static code analysis report

Run started:2024-09-19 09:32:00.600751

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 4968
  Total lines skipped (#nosec): 2
  Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 6

Run metrics:
  Total issues (by severity):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
  Total issues (by confidence):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
Files skipped (0):

@cbartz cbartz merged commit c74701f into main Sep 19, 2024
41 checks passed
@cbartz cbartz deleted the fix/add-timeout-before-dispatch branch September 19, 2024 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants